#!/usr/bin/python

'''
	This is the interface between the HTML form and scripts for the GOODMAN exposure time calculator.
'''

#
# Loading apropriate libraries
#

import sys,os
import cgi
import cgitb
cgitb.enable()
from calcF import * # important definitions for the ITC

os.environ[ 'HOME' ] = '/tmp/'

import matplotlib
matplotlib.use( 'Agg' )
import pylab as py
import numpy as np

ww,ff = np.loadtxt('/tmp/snr_results.txt',unpack=True)

print "Content-type: image/png\n"

py.plot(ww,ff)
py.savefig(sys.stdout,format='png')
#print "Content-type: text/html \n"

#print "<p> testse </p>"
